// 获取应用实例
const app = getApp()

Page({
  data: {
    isTakeout: false,
    address: '北京市朝阳区望京SOHO塔1A座1001室',
    currentGoodsId: "0",
    payConfirmVisible:false,
    paymentMethods: [
      { type: 'wechat', name: '微信支付', amount: 100.00 },
      { type: 'balance', name: '余额支付', amount: 30.00 }
    ]
  },
  
  // 生命周期
  async onReady() {
   
  },
  
  onShow() {
    // const systemInfo = wx.getSystemInfoSync();
    // const height = res.screenHeight - (res.safeArea.bottomt?res.safeArea.bottomt:0) + 54;
    // console.log('tabbar的高度约为：', height);
  },
  onLoad(option) {

  },
  handlePopup(e) {
    this.setData({
      currentGoodsId: "1906270846557884416",
      visible: true
    });
  },
  widgetOrderCanceCard() {
    this.setData({
      visible: false,
    });
  },
  widgetOrderAddCard(newGoods) {
    //关闭弹框
    this.setData({
      visible: false,
    });
  },
  handleMyAddress(){
    wx.navigateTo({
      url: '/pages/user-address/index?modalType=1',
    })
  },
  index2(){
    wx.navigateTo({
      url: '/pages/index/index?modalType=1',
    })
  },
  orderConfirm(){
    wx.navigateTo({
      url: '/pages/order-confirm/index?modalType=1',
    })
  },
  pickup(){
    wx.navigateTo({
      url: '/pages/pickup/index?modalType=1',
    })
  },
  //---------------------支付确认-----------------------------
  payConfirm(){
    this.setData({
      payConfirmVisible:true
    })
  },
  onPayBack(e){
    this.setData({
      payConfirmVisible:false
    })
  }
});